﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Perfect Buy</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/html5")
</head>
<body>
    @{
        List<PerfectBuyData.CarritoArticulo> carrito = (List<PerfectBuyData.CarritoArticulo>)Session["carrito"];
        PerfectBuyData.Usuario usuario = (PerfectBuyData.Usuario)Session["Usuario"];  
    }
    <header>
        <div class="wrapper">
            <h1><a id="brand" href="../Home/Index" title="ABC comp">ABC comp</a></h1>
            <nav>
                <ul>
                    <li>@Html.ActionLink("Articulos", "Articulos", "Home", new { productCategory = "todos", listArt = new List<object>() }, null)
                        <ul class="sub-menu">
                            <li>@Html.ActionLink("TV y Home Theater", "Articulos", "Home", new { productCategory = "Tv & Home Theater", listArt = new List<object>() }, null)</li>
                            <li>@Html.ActionLink("Videocámaras", "Articulos", "Home", new { productCategory = "Videocámaras", listArt = new List<object>() }, null)</li>
                            <li>@Html.ActionLink("Computadoras y Tablets", "Articulos", "Home", new { productCategory = "Computadoras & Tablets", listArt = new List<object>() }, null)</li>
                            <li>@Html.ActionLink("Celulares", "Articulos", "Home", new { productCategory = "celulares", listArt = new List<object>() }, null)</li>
                        </ul>
                    </li>
                    <li>@Html.ActionLink("¿Quiénes Somos?", "About", "Home")</li>
                    <li>@Html.ActionLink("Contacto", "Contact", "Home")</li>
                    @{if (usuario != null && usuario.rol == 0)
                      {
                        <li>@Html.ActionLink("Administración", "Index", "Administracion")
                            <ul class="sub-menu">
                                <li>@Html.ActionLink("Articulos", "Index", "Administracion")</li>
                                <li>@Html.ActionLink("Compras", "Index", "Historial")</li>
                                <li>@Html.ActionLink("Usuarios", "Index", "Usuarios")</li>
                            </ul>
                        </li>
                      }
                    }
                    <li>@Html.ActionLink("Libro de visitas", "Index", "GuestBook")</li>
                </ul>
            </nav>
        </div>
    </header>
    <aside id="top">
        <div class="wrapper">
            <ul id="social">
                <li><a class="facebook" href="#" title="like us us on Facebook">like 
			us us on Facebook</a></li>
                <li><a class="twitter" href="#" title="follow us on twitter">follow 
			us on twitter</a></li>
            </ul>
            @using (Html.BeginForm("Articulos", "Home", FormMethod.Post))
            {
                <form id="buscar" action="buscar">
                    <input id="campoBuscar" name="textoBuscar" placeholder="Buscar" type="text" />
                    <button id="btnBuscar" type="submit">Search</button>
                </form>
            }
            @{if (Session["Usuario"] != null)
              {
                <div id="action-bar">

                 <a href=@Url.Action("Index", "Historial", new { user=usuario})>@usuario.userName</a> /
                 <a href=@Url.Action("Logout", "Login")>Cerrar Sesión</a> / <a href=@Url.Action("CarritoCompras", "CarritoCompras")>Mi carrito (@carrito.Count)</a>
                </div>
            
              }
              else
              {
                <div id="action-bar">
                    <a href=@Url.Action("Login", "Login")>Iniciar Sesión</a> /
                     <a href=@Url.Action("Register", "Login")>Registrarse</a> / 
                    <a href=@Url.Action("CarritoCompras", "CarritoCompras")>Mi carrito (@carrito.Count)</a>
                </div>
              }
            }
            }
        </div>
    </aside>
    <div id="body">
        @RenderSection("featured", required: false)
        @RenderBody()
    </div>
    @*<footer>
	<div class="wrapper">
        &copy; Perfect Buy <a href="#">Sitio del mapa</a> <a href="#">Terminos y Condiciones</a> <a href="#">Devoluciones</a><a href="#">Ayuda</a> <br />
    </div>
</footer>*@
    @Scripts.Render("~/bundles/jquery")
    @RenderSection("scripts", required: false)
</body>
</html>
